package xin.mydreams.mybill.util;

import org.springframework.boot.system.ApplicationHome;

import java.io.File;

public class FileUtil {

    /**
     * 获取头像位置文件夹
     * @return
     */
    public static String getPhotoPath(){
        //指定本地文件夹存储图片
        ApplicationHome home = new ApplicationHome(FileUtil.class);
        File jarFile = home.getSource();
        String filePath = jarFile.getParent();
        File file=new File(filePath,"photo");
        System.err.println(file.getAbsolutePath());
        if(!file.exists()){
            file.mkdirs();
        }
        return file.getAbsolutePath();
    }
}
